Arduino Protocol
The Arduino protocol is necessary to tell the Arduino board how it should interact with TPT. The protocol is part of the TPT node as well as of the INO code you flash onto your Arduino board. Both must be congruent. For example, if the Arduino board pin A0 is specified as input for TPT and as output in the Arduino INO file, the communication between TPT and the Arduino board will fail.
Protocol changes must therefore be applied always to both the Arduino Nodeand the Arduino INO code. In case of the Arduino example in TPT, the protocol changes must be applied to the file Arduino_node.c
, the Arduino.c
file that can be found in <TPT installation path>\examples\SUT-Arduino
.
The Arduino_node.c
connects TPT to the Arduino Node. The file can be found in <TPT installation path>\examples\SUT-Arduino
. Open this file in an editor like Notepad and enter the COM port to your Arduino board in line 33 that reads char* comPort="COMxx"
and enter the baudrate in line 34 that reads int baudRate = 2000000
.
Arduino.c
connects the Arduino Node to the Arduino board. The file can be found in <TPT installation path>\examples\SUT-Arduino
.
By default, the protocol is specified in the Arduino Node as follows:
From Arduino to TPT
Specifies which data values can be processed by the Arduino Node. By default, there are 16 digital pins and 16 analog pins.
Numerical data values are send as string values by the Arduino board. Inside the string, the numerical data values are available as hexadecimal values.
Using the minus sign, the Arduino board signals TPT that new data set will be send.
From TPT to Arduino
Specifies which data values can be processed by the Arduino board pins. By default, there are 16 digital pins and 12 analog pins.
Numerical data values are send as string values by the Arduino Node. Inside the string, the numerical data values are available as hexadecimal values.
Using the minus sign, TPT signals the Arduino board that new data set will be send.